package oop7;

/**
 * @author oldliu
 * @since 1.0
 */
public class Calc {
    public int add(int a, int b) {
        return a + b;
    }

    //    public int div(int a,int b)throws Exception{
//        try {
//            int c = a / b;
//            return c;
//        }catch (Exception e){
//           e.printStackTrace();
//           throw e;//算一个返回值
//        }
//
//    }
    public int div(int a, int b) throws Exception {
        try {
            int c = a / b;
            return c;
        } catch (Exception e) {
            e.printStackTrace();//欺上瞒下
        }
        return 0;
    }
}
